Repository navigation
fix(config): apply the config that was parsed and ignored - #181
Conversation
Greptile SummaryThis PR applies previously ignored policy, pipeline-threshold, and scanner-override configuration while preserving source precedence and validating reconstructed values.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| sdk/src/unplug/config/loader.py | Resolves policy sources consistently, validates threshold propagation, and merges scanner overrides onto bundled defaults. |
| sdk/src/unplug/config/guard.py | Adds bounded validation to pipeline threshold fields. |
| sdk/tests/unit/config/test_config_loader.py | Adds broad regression coverage for policy precedence, threshold synchronization, malformed values, and partial scanner overrides. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A["pipeline.policy"] --> M["Resolve policy by precedence"]
B["top-level policy"] --> M
C["guard.policy"] --> M
D["pipeline.thresholds"] --> M
M --> G["Guard policy"]
M --> P["Pipeline policy"]
M --> T["Pipeline thresholds"]
E["Scanner overrides"] --> V["Validate over bundled defaults"]
F["Bundled scanner defaults"] --> V
V --> S["Effective scanner configs"]
Reviews (5): Last reviewed commit: "Merge remote-tracking branch 'origin/dev..." | Re-trigger Greptile
SDK Coverage •
|
|||||||||||||||||||||||||||||||||||
|
All three were real. Fixed in 4a52e48. The two validation ones were regressions I introduced.
The policy one was not a regression, since top-level Four more tests. 721 passing, same 2 unrelated ML model-store failures. |
6c6f25f to
4e8372b
Compare
…es-169 # Conflicts: # sdk/tests/unit/config/test_config_loader.py
Fixes #169.
Three config surfaces parsed without error and then did nothing. All three now apply.
Top-level
[policy].build_configread policy only out of[guard], with no top-level fallback, unlikepipeline,limits,messages,toolsandboundaries.unplug.example.tomlships[guard]at line 3 and[policy]at line 101, so the whole block was dead for anyone who copied the example.[guard.policy]still wins where both name a key.[pipeline.thresholds]. These were folded intopipeline.policy, which nothing scans with:Guardbuilds every request policy from the guard-level one, andBasePipeline._resolve_policyprefers the context policy. A pipeline run with no context was the only path that saw them, and the public API never takes it, so one file gaveGuard.scanandPipeline.runtwo different actions for the same input. They now fold into the guard policy as well. An explicit[policy]key still wins.Partial
scanners_configentries. A table naming one field built a freshScannerConfig, so every unnamed field fell to the pydantic class default instead of the bundled one.secretsdropped 0.99 to 0.85 andinjectionlostnormalize, both silently and both weakening, for anyone setting a single key. Overrides now merge ontodata/defaults/scanners.toml, which is what that file says it is for. A scanner with no bundled entry is unchanged.Seven tests, all four of the behaviour changes fail on dev:
717 passed on the branch, 710 on dev, same 2 unrelated ML model-store failures on both (local model cache; #163 and PR #175 cover those). ruff clean.